import React, { Component } from 'react';
import eventBus from './evt'
class Child1 extends Component {
    state = {
        msg: '我是你哥哥'
    }
    render() {
        return (
            <div onClick={this.emitFn}>
                child1
            </div>
        );
    };
    emitFn = () => {
        // 将兄弟1 组件中的数据发射传递给兄弟组件2
        eventBus.emit('transfer', this.state.msg)
    }
}

export default Child1;
